package demo1;


// 关于clone方法

import java.util.Arrays;
import java.util.Objects;

/*class Person extends Object {
    String name;
    int age;

  *//* // @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }*//*
}
public class Test {
    public static void main(String[] args) {
        Person person1 = new Person();
        Person person2 =  person1.clone();
    }
}*/
//关于不能引用的问题：
//空方法体的问题？
/*
class Animal{
    String name;
    public void shout(){

    }

}
class Dog extends Animal{


}

public class Test {
    public static void main(String[] args) {
        Dog dog1 = new Dog();
        dog1.shout();
    }
}
*/
//Object类
//Object类是java中提供的类，它可以说是所有的类父类，所有的类都继承Object类
//例如：下面的类中，虽然Dog的直属父类是Animal，但是Animal继承了Object类，所以Dog类也继承了Object类
/*class Animal{



}
class Dog extends Animal{



}*/
// Object类当中的方法
// equals
//hashcode
/*
class Dog {
    String name;
    int age;

    public Dog(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public boolean equals(Object o) {
        //Object需要先进行强制类型转换
        Dog tmp = (Dog) o;
        return tmp.age == this.age
                && tmp.name.equals(this.name);

    }

*/
/*    @Override
    public int hashCode() {
        return Objects.hash(name, age);
    }
}*//*

}
    public class Test {
        public static void main(String[] args) {
            Dog dog1 = new Dog("旺财",10);
            Dog dog2 = new Dog("旺财",10);
            //dog1.equals(dog2)
            Object o = new Object();
           */
/* System.out.println(dog1 == dog2);
            System.out.println(dog1.equals(dog2));
*//*


            System.out.println(dog1.hashCode());
            System.out.println(dog2.hashCode());
            System.out.println();
        }
    }
*/
//toString方法
public class Test {



    public static void main(String[] args) {
         Object o = new Object();
          int [] arr1 = {1,2,3,4,5};
         System.out.println(arr1);
        System.out.println(arr1.toString());
        System.out.println(Arrays.toString(arr1));
    }
}





























